package com.ruoyi.playlist.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.playlist.mapper.PlaylistMapper;
import com.ruoyi.playlist.domain.Playlist;
import com.ruoyi.playlist.service.IPlaylistService;

/**
 * 歌单Service业务层处理
 * 
 * @author lin
 * @date 2025-03-04
 */
@Service
public class PlaylistServiceImpl implements IPlaylistService 
{
    @Autowired
    private PlaylistMapper playlistMapper;

    /**
     * 查询歌单
     * 
     * @param id 歌单主键
     * @return 歌单
     */
    @Override
    public Playlist selectPlaylistById(Long id)
    {
        return playlistMapper.selectPlaylistById(id);
    }

    /**
     * 查询歌单列表
     * 
     * @param playlist 歌单
     * @return 歌单
     */
    @Override
    public List<Playlist> selectPlaylistList(Playlist playlist)
    {
        return playlistMapper.selectPlaylistList(playlist);
    }

    /**
     * 新增歌单
     * 
     * @param playlist 歌单
     * @return 结果
     */
    @Override
    public int insertPlaylist(Playlist playlist)
    {
        return playlistMapper.insertPlaylist(playlist);
    }

    /**
     * 修改歌单
     * 
     * @param playlist 歌单
     * @return 结果
     */
    @Override
    public int updatePlaylist(Playlist playlist)
    {
        return playlistMapper.updatePlaylist(playlist);
    }

    /**
     * 批量删除歌单
     * 
     * @param ids 需要删除的歌单主键
     * @return 结果
     */
    @Override
    public int deletePlaylistByIds(Long[] ids)
    {
        return playlistMapper.deletePlaylistByIds(ids);
    }

    /**
     * 删除歌单信息
     * 
     * @param id 歌单主键
     * @return 结果
     */
    @Override
    public int deletePlaylistById(Long id)
    {
        return playlistMapper.deletePlaylistById(id);
    }

    @Override
    public List<Playlist> selectPlaylistByUserId(Integer userId) {
        return playlistMapper.selectPlaylistByUserId(userId);
    }
}
